loaddata;
OY = [0 1 2 3 1 4 4 5 6 7 7 8 9 10 11 12 14 14 15 17 16 13 18 19 19 20 29 28 23 30 32 33 35 31 34 36 25 27 21 22 24 26 27 37 38 38 38 38 ];
[X Y] = read_pc('halS1_dev.X','dev.Y48');

C = size(HP,1);
CM = zeros(C,48);

for a = 1:C
    for b = 1:C
        CM(a,b) = sum([
        sum( sign([X(Y==a,:) ones(sum(Y==a),1)]*squeeze(HP(a,b,:))) < 0 ) ;
        sum( sign([X(Y==b,:) ones(sum(Y==b),1)]*squeeze(HP(a,b,:))) > 0 ) ]) / (sum(Y==a) + sum(Y==b));
    end
end
[V I] = max(CM);
